<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      >
    <ui:composition template="/secured/template/common/commonLayout.xhtml">
        <ui:define name="commonHeader" />

        <ui:define name="content">
            <h:form id="form"> 
                <CENTER><h1>Operator Intervention View</h1></CENTER> 
                <p:growl id="msg"  />  
                <p:dataTable 
                             id="basicc" 
                             var="ticket"    
                             value="#{opc.monData}"  
                             paginator="true" 
                             rows="10"  
                             paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"  
                             rowsPerPageTemplate="5,10,15"   
                             selection="#{opc.model.selectedTicket}"                             
                             selectionMode="single" 
                             rowKey="#{ticket.idTicket}"
                             >  
                    <p:ajax event="rowSelect"  listener="#{opc.onRowSelect}" update=":form:display" oncomplete="carDialog.show()" /> 
                    <f:facet name="header">  
                        List Tickets available: 
                    </f:facet>                     
                    <p:column id="h">   
                        <f:facet name="header">  
                            List Tickets available: 
                        </f:facet>  
                        <h:outputText value="#{ticket.idTicket}"/> 
                    </p:column>   
                    <p:column id="c1">  
                        <f:facet name="header">  
                            Ticket status
                        </f:facet>  
                        <h:outputText value="#{ticket.status}" />  
                    </p:column>   
                    <p:column id="c2">  
                        <f:facet name="header">  
                            Ticket status
                        </f:facet>  
                        <h:outputText value="#{ticket.startTime}" />   
                    </p:column>                           
                    <p:column id="c3">  
                        <f:facet name="header">  
                            Incident subject
                        </f:facet>  
                        <h:outputText value="#{ticket.incident.incident_subject}" />   
                    </p:column>  
                    <p:column id ="c4">  
                        <f:facet name="header">   
                            Incident degree  
                        </f:facet>  
                        <h:outputText value="#{ticket.incident.incident_degree}" />   
                    </p:column>  
                    <p:column id="c5">  
                        <f:facet name="header">   
                            Incident Time Estimated  
                        </f:facet>  
                        <h:outputText value="#{ticket.incident.incident_time_estimated}" />   
                    </p:column>  
                    <f:facet name="footer">  
                        <p:commandButton id="viewButton" value="View" icon="ui-icon-search"  
                                         oncomplete="carDialog.show()"/>  
                    </f:facet>   
                </p:dataTable>  
                <!--                </p:panel>-->

                <p:dialog  id ="eventDialog" widgetVar="carDialog" header="Choose action to perform:" showEffect="clip" hideEffect="clip">  
                    <!--                    <p:panel header="Operator Intervention:" footer="">  -->
                    <h:panelGrid columns="2" id="display" >  
                        <h:outputLabel value="Ticket Id:" />  
                        <h:outputText value="#{opc.model.selectedTicket.idTicket}" />  

                        <h:outputLabel value="" />  
                        <p:selectOneRadio id="customRadio"  layout="custom" value="#{opc.model.operatorChoice}">  
                            <f:selectItem itemLabel="Option 1" itemValue="DISPATCH" />   
                            <f:selectItem itemLabel="Option 2" itemValue="DIFFER" />  
                            <f:selectItem itemLabel="Option 3" itemValue="NPCOM" />   
                        </p:selectOneRadio>  

                        <p:radioButton id="opt1" for="customRadio" itemIndex="0"/>  
                        <h:outputLabel for="opt1" value="dispatch ticket:" />  

                        <p:radioButton id="opt2" for="customRadio" itemIndex="1"/>  
                        <h:outputLabel for="opt2" value="differ ticket:" />  

                        <p:radioButton id="opt3" for="customRadio" itemIndex="2"/>  
                        <h:outputLabel for="opt3" value="NPCOM:" />   
                    
                    </h:panelGrid>   
                    <!--                    </p:outputPanel>  -->
                    <p:commandButton id="submitButton"  value="View" icon="ui-icon-search"  
                                     update=":form:display"
                                          oncomplete="carDialog.hide()"  
                                     action="#{opc.sendChoice}"/>    
                    <!--                    </p:panel>-->
                </p:dialog>   
            </h:form>
        </ui:define> 
        <ui:define name="commonFooter"/>   
    </ui:composition> 
</html>